Repository navigation
fix(studio): locale-correct live addresses; "View live" in editors - #77
Merged
Merged
Conversation
The stored path of a page has no locale prefix (`(site, locale, path)` is unique; the renderer strips `/<locale>` before the lookup), so #75 showed `/hakkinda` for a Turkish page served at `/tr/hakkinda`, missed prefixes under prefix-all routing, and showed only the path for articles in other locales. - core-ts `locale-paths.ts` (`@cloudhal/core-ts/locale-paths`): `localeRouting`, `localizedPath`, `localeUrl` moved from the renderer (which re-exports them, unchanged), plus `itemUrl(site, origin, item)` for a page or an entry, with per-locale domains. - Studio: addresses, row links and the live check use `itemUrl`; a "View live" button in the page and article editor headers, shown only when the live snapshot serves the item at its address. - Bundle: the app-root Shiki provider pulled Kumo's code module into the entry chunk; code blocks now bring their own (`CodeHighlighted`), and a budget guard keeps it lazy. Entry gzip 418.8 → 415.9 kB. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to #75.
The bug in #75
A page's stored path has no locale prefix:
(site, locale, path)is unique, the renderer'slocaleRequeststrips/<locale>, andpageByPath(path, locale)matches on both. #75 used the stored path as the URL, so it showed/hakkindafor a Turkish page served at/tr/hakkinda. It also missed the prefix for every locale underprefix-allrouting, and showed only the path for articles in other locales.Fix
locale-paths.ts(Worker- and browser-safe;@cloudhal/core-ts/locale-paths):localeRouting,localizedPathandlocaleUrlmoved from the renderer, unchanged; the renderer re-exports them.itemUrl(site, origin, item)for a page or an entry: the graph path (entryPathfor entries), then the locale's prefix or its own domain.itemUrl) all use it."View live" in the editors
A ghost external
LinkButtonnext to the preview toggle in the page and article editor headers, icon-only belowlg, with the full URL in the tooltip. It appears only when the live snapshot serves this item at its address, and shares the address query, so there is no extra request.Bundle headroom
The app-root
ShikiProviderpulled Kumo'scode.jsinto the entry chunk and started Shiki on every load. Code blocks now bring their own provider (CodeHighlighted), andbundle-budget.tsguardscode.jsas lazy-only. Entry gzip: 418.8 → 415.9 kB (budget 420).Checks (one package at a time)
locale-paths.test.ts: prefix-except-default, prefix-all,tr, per-locale domains,/,itemUrl)live-locales.test.tsx:trpage and article addresses, prefix-all, per-locale domain, row links, and "View live" shown or hidden)Also passing: typecheck, design lint (349 files), and the size ratchet. Screenshots of the article and page editors, Articles and Skills at 1440 and 390 px passed (no sideways scroll or console errors). The local test site is English-only, so localized URLs are covered by tests rather than screenshots.
🤖 Generated with Claude Code